package rhinestone.Model;
/**
 * Represents a customer, which is hold in a CustomerContainer.
 * 
 * @author Group 2
 * @version 2010.12.15
 */
public class Customer extends Person
{
    // instance variables - replace the example below with your own
    private Discount discount;

    /**
     * Constructor for objects of class Customer
     */
    public Customer(String name, String address, String cpr, String phone, double generalDisc, double craftsManDisc, double deliveryDisc)
    {
        super(name, address, cpr, phone);
        discount = new Discount(generalDisc, craftsManDisc, deliveryDisc);
    }

	public void setDiscount(double generalDisc, double craftsManDisc, double pickUpDisc) {
		discount = new Discount(generalDisc, craftsManDisc, pickUpDisc);
	}

	public double getGeneralDiscount() {
		return discount.getGeneralDiscount();
	}
	public void setGeneralDiscount(double generalDiscount) {
		discount.setGeneralDiscount(generalDiscount);
	}

	public double getCraftsmanDiscount() {
		return discount.getCraftsmanDiscount();
	}
	public void setCraftsmanDiscount(double craftsmanDiscount) {
		discount.setCraftsmanDiscount(craftsmanDiscount);
	}

	public double getDeliveryDiscount() {
		return discount.getDeliveryDiscount();
	}
	public void setDeliveryDiscount(double deliveryDiscount) {
		discount.setDeliveryDiscount(deliveryDiscount);
	}

	/**
	 * Object representation for printing.
	 * No need to call it manually, it is called automatically
	 * whenever you put this object in System.out.println();
	 */
	@Override
	public String toString() {
		String output = "CPR: " + cpr;
		output += "\nName: " + name;
		output += "\nAddress: " + address;
		output += "\nPhone: " + phone;
		output += "\nGeneral discount: " + discount.getGeneralDiscount();
		output += "\nCraftsman discount: " + discount.getCraftsmanDiscount();
		output += "\nDelivery discount: " + discount.getDeliveryDiscount();
		return output;
	}
}
